package com.jigang.study.eureka.client.provider.web.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Provider Controller
 *
 * @author wujigang
 * @date 2022-05-01 23:25
 **/
@RestController
@RequestMapping("/provider")
@Slf4j
public class ProviderController {

    @Autowired
    private Environment environment;

    @RequestMapping("info")
    public String getInfo() {
        log.info("Receive request.");
        return "eureka-provider-" + environment.getProperty("server.port");
    }
}
